package com.zrc.superframe_net.interceptor

import okhttp3.Interceptor
import okhttp3.Response

/**
 * @Author: superman
 * @CreateTime: 6/27/21
 * @Describe:请求前的拦截器(用于添加请求头)
 */
class RequestInterceptor :Interceptor{
    override fun intercept(chain: Interceptor.Chain): Response {
        val builder= with(chain.request().newBuilder()){
//            this.addHeader("X-LC-SESSION", "")
//            this.addHeader("CJS-Pro-Session", "")
            this.addHeader("Content-Type", "application/json; charset=utf-8")
//            this.addHeader("App-Type", "android")
//            this.addHeader("Version-Number", "5.2.0")
            this
        }
        //Log.e("ZRC","Request")
        return chain.proceed(builder.build())
    }
}